import base from '@feidao-factory/send-msg/config';

interface IFeidaoConfig {
	debug: boolean;
	mqtt: string;
	type: string;
	spaceid: string;
	RABBITMQ: string;
	EXPIRATION: number;
	TIMEOUT: number;
	PREFETCH_COUNT: number;
	DELIVERY_MODE: number;
	SIGN_ROUTER_QUEUE_NAME: string;
	JS_REPLY_QUEUE_NAME: string;
	JS_QUEUE_NAME: string;
	MESSAGE_TYPE: string;
	ZK_HOSTS: string;
	ZK_OPTIONS: {
		sessionTimeout: number;
		spinDelay: number;
		retries: number;
	};
	SOA_ID: string;
}

const config = base as unknown as IFeidaoConfig;
const jsgroup = `${config.spaceid}-${config.type}`;
config.JS_QUEUE_NAME = `q_service_nodejs_${jsgroup}_intranet`;
config.MESSAGE_TYPE = `dataservice.nodejs.${jsgroup}.intranet`;

export default config;
